<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="设置状态" bodyClass="white-bg" libs=["bootstrapSelect"]/>
<div class="wrapper wrapper-content ibox-content">
    <@f.form id="form-user-add" class="form-horizontal">
    <h4 class="form-header h4">填写基本信息</h4>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>员工编号：</label>
                <div class="col-sm-8">
                    <input name="id" id="id"  value="${quit.id?default('')}" type="hidden" >

                    <input name="userCode" id="userCode" placeholder="请输入员工编号" value="${quit.userCode?default('')}" class="form-control" type="text" maxlength="30" readonly  required>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>员工姓名：</label>
                <div class="col-sm-8">
                    <input name="userName" id="userName" placeholder="请输入员工姓名" value="${quit.userName?default('')}" class="form-control" type="text" maxlength="30" readonly  required>
                </div>
            </div>
        </div>

    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>手机号码：</label>
                <div class="col-sm-8">
                    <input name="mobile" id="mobile" placeholder="请输入手机号码" value="${quit.mobile?default('')}" class="form-control" type="text" maxlength="30" readonly  required>

                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>身份证：</label>
                <div class="col-sm-8">

                    <input name="card" id="card" placeholder="请输入婚姻状况" value="${quit.card?default('')}" class="form-control" type="text" maxlength="30" readonly  required>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <!--<div class="col-sm-6">-->
            <!--<div class="form-group">-->
                <!--<label class="col-sm-4 control-label"><span style="color: red; ">*</span>是否离职</label>-->
                <!--<div class="col-sm-8">-->
                    <!--<label class="toggle-switch switch-solid">-->
                        <!--<input type="checkbox" id="status" checked>-->
                        <!--<span></span>-->
                    <!--</label>-->
                    <!--&lt;!&ndash;<@f.input name="iphone"  maxlength="11" value="${quit.iphone?default('')}" butClass="fa fa-fw fa-mobile"  placeholder="请输入手机号码" required=true/>&ndash;&gt;-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->

        <div class="col-sm-6">
            <div class="form-group">
            <label class="col-sm-4 control-label">是否离职：</label>
                <div class="col-sm-8">
                    <@f.radio name="status" dictType="hr_status" value="${quit.status?default('')}"  />

                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>离职原因：</label>
                <div class="col-sm-8">
                    <input name="quitReason" id="quitReason" placeholder="请输入员工姓名" value="${quit.quitReason?default('')}" class="form-control" type="text"    required>

                </div>
            </div>
        </div>

    </div>

</@f.form>
<div class="hr-line-dashed"></div>
<div class="row" id="_addTab">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="opt.form.submit()"><i class="fa fa-check"></i><@ctx.i18n text = "保存"/></button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="opt.modal.closeTab()"><i class="fa fa-reply-all"></i><@ctx.i18n text = "关闭"/></button>
    </div>
</div>
</div>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "bus/personnel";

    /**
     * 表单前端校验
     **/
    // $("#form-user-add").validate({
    //     onkeyup: false,
    //     rules:{
    //         username:{
    //             minlength: 3,
    //             maxlength: 10,
    //             isUserName: opt.common.trim($("#username").val()),
    //             remote: {
    //                 url: prefix + "/checkUserNameUnique",
    //                 type: "POST",
    //                 dataType: "html",
    //                 data: {
    //                     "username": function() {
    //                         return opt.common.trim($("#username").val());
    //                     }
    //                 },
    //                 dataFilter: function(data, type) {
    //                     return opt.validate.unique(data);
    //                 }
    //             }
    //         },
    //         password:{
    //             minlength: 5,
    //             maxlength: 20
    //         },
    //         _role:{
    //             minlength: 1
    //         },
    //         _posts:{
    //             minlength: 1
    //         },
    //         mobile:{
    //             isMobile: opt.common.trim($("#mobile").val()),
    //             remote: {
    //                 url: prefix + "/checkMobileUnique",
    //                 type: "POST",
    //                 dataType: "html",
    //                 data: {
    //                     "mobile": function() {
    //                         return opt.common.trim($("#mobile").val());
    //                     }
    //                 },
    //                 dataFilter: function(data, type) {
    //                     return opt.validate.unique(data);
    //                 }
    //             }
    //         }
    //     },
    //     messages: {
    //         "username": {
    //             remote:"<@ctx.i18n text = "sys.msg.user.already"/>"
    //         },
    //         "mobile":{
    //             remote:"<@ctx.i18n text = "sys.msg.mobile.already"/>"
    //         }
    //     },
    //     focusCleanup: true
    // });

    /**
     * Tab 页面点击确认按钮执行事件
     **/
    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.saveTab(prefix + "/quit", $('#form-user-add').serialize());
        }
    }

    /**
     * select 回调事件
     * @param id 那个select控件发出的事件
     * @param event change 当控件改变时
     * @param data 选中数据对象
     */
    // function selectCallback(id, event, data){
    //     if(id === "roleIdList"){
    //         console.log("roleIdList:" + data);
    //     }else if(id === "postCodes"){
    //         console.log("postCodes:" + data);
    //     }
    // }
</script>
</@footer>
</@pageTheme>